<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .a{
            width: 400px;
            height: 400px;
            border: 1px solid #000;
            text-align: center;

            /* 转化为类似表格的东西 */
            display: table;
        }

        .a span {
            /* 单元格  td */
            display: table-cell;
            vertical-align: middle;
        }

    </style>
</head>

<body>

    <!-- 

        display:inline / inline-block / block / none

        display:table

     -->

    <div class="a">
        <span>
            <img src="https://img12.360buyimg.com/seckillcms/s280x280_jfs/t1/165106/14/31693/106745/637ada9bE0426e5a7/820cda73d9fe95cb.jpg.avif"
                alt="">
        </span>
    </div>

</body>

</html>